package config

import (
	"github.com/spf13/viper"
	"log"
)

type Mysql struct {
	User     string
	Password string
	Host     string
	Root     int
	Database string
}
type Redis struct {
	Password string
	Host     string
	Root     int
}
type App struct {
	Mysql
	Redis
}

var Apps *App

func InitConfig() {
	viper.SetConfigFile("D:/gowork/src/youku/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Apps)
	log.Println(Apps)
}
